package com.ruoyi.teamCustomer.controller;

import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.customer.common.DisCustomerRequestBo;
import com.ruoyi.customerPool.domain.vo.UserVo;
import com.ruoyi.teamCustomer.domain.bo.TeamCustomerBo;
import com.ruoyi.teamCustomer.domain.vo.TeamCustomerVo;
import com.ruoyi.teamCustomer.service.ITeamCustomerService;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequiredArgsConstructor
@RestController
@RequestMapping("/teamCustomer")
public class TeamCustomerController {

    private final ITeamCustomerService teamCustomerService;


    /**
     * 团队客户
     */
    @GetMapping("/atTeamCustomer")
    public TableDataInfo<TeamCustomerVo> atTeamCustomer(TeamCustomerBo bo, PageQuery pageQuery) {
        return teamCustomerService.pageTeamCustomer(bo, pageQuery);
    }

    /**
     * 团队客户
     */
    @GetMapping("/queryInfoList")
    public R<List<TeamCustomerVo>> queryInfoList(TeamCustomerBo bo) {
        return R.ok(teamCustomerService.queryInfoList(bo));
    }


    /**
     * 团队用户列表
     */
    @GetMapping("/teamUserList")
    public R<List<UserVo>> teamUserList(SysUser bo) {
        return R.ok(teamCustomerService.teamUserList(bo));
    }


    /**
     * 团队客户转移 to 用户
     */
    @PostMapping("/teamCustomerTransferToUser")
    public R<Void> teamCustomerTransferToUser(@RequestBody DisCustomerRequestBo transferBo) {
        teamCustomerService.teamCustomerTransferToUser(transferBo);
        return R.ok();
    }

    /**
     * 团队客户转移 to 部门
     */


    @PostMapping("/teamCustomerTransferToDept")
    public R<Void> teamCustomerTransferToDept(@RequestBody DisCustomerRequestBo transferBo) {
        teamCustomerService.teamCustomerTransferToDept(transferBo);
        return R.ok();
    }



}
